package com.ruoyi.businessInfo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.businessInfo.mapper.BedConfigMapper;
import com.ruoyi.businessInfo.domain.BedConfig;
import com.ruoyi.businessInfo.service.IBedConfigService;

/**
 * 床型配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class BedConfigServiceImpl implements IBedConfigService 
{
    @Autowired
    private BedConfigMapper bedConfigMapper;

    /**
     * 查询床型配置
     * 
     * @param bedId 床型配置主键
     * @return 床型配置
     */
    @Override
    public BedConfig selectBedConfigByBedId(Long bedId)
    {
        return bedConfigMapper.selectBedConfigByBedId(bedId);
    }

    /**
     * 查询床型配置列表
     * 
     * @param bedConfig 床型配置
     * @return 床型配置
     */
    @Override
    public List<BedConfig> selectBedConfigList(BedConfig bedConfig)
    {
        return bedConfigMapper.selectBedConfigList(bedConfig);
    }

    /**
     * 新增床型配置
     * 
     * @param bedConfig 床型配置
     * @return 结果
     */
    @Override
    public int insertBedConfig(BedConfig bedConfig)
    {
        bedConfig.setCreateTime(DateUtils.getNowDate());
        return bedConfigMapper.insertBedConfig(bedConfig);
    }

    /**
     * 修改床型配置
     * 
     * @param bedConfig 床型配置
     * @return 结果
     */
    @Override
    public int updateBedConfig(BedConfig bedConfig)
    {
        bedConfig.setUpdateTime(DateUtils.getNowDate());
        return bedConfigMapper.updateBedConfig(bedConfig);
    }

    /**
     * 批量删除床型配置
     * 
     * @param bedIds 需要删除的床型配置主键
     * @return 结果
     */
    @Override
    public int deleteBedConfigByBedIds(Long[] bedIds)
    {
        return bedConfigMapper.deleteBedConfigByBedIds(bedIds);
    }

    /**
     * 删除床型配置信息
     * 
     * @param bedId 床型配置主键
     * @return 结果
     */
    @Override
    public int deleteBedConfigByBedId(Long bedId)
    {
        return bedConfigMapper.deleteBedConfigByBedId(bedId);
    }
}
